<!-- Calendar entry -->

%%[begin:C]%%

<form action="%%[base_url]%%/ops/update_activity.php" name="ea" method="post">

    <h2>Calendar Item</h2>

    <div id="activity">
    
        <dl>

            <dt><label>Case</label></dt>
            <dd>%%[new_case_menu]%%</dd>
        
            <dt><label>Summary | Title</label></dt>
            <dd>%%[summary,input_textarea,rows=1,cols=44]%%</dd>
        
            <dt><label>Case Notes</label></dt>
            <dd>%%[notes,input_textarea,rows=11,cols=44]%%</dd>
        
        </dl>    

        <dl>

             <dt><label>Date</label></dt>
            <dd id="work-date">%%[act_date,input_date]%% onkeydown="pika_date(this);"maxlength="10" tabindex="1" /></dd>
        
            <dt><label>Start Time</label></dt>
            <dd id="start"><input type="text" name="act_time" value="%%[act_time]%%" tabindex="1" /></dd>

            <dt><label>End Time</label></dt>
            <dd id="end"><input type="text" name="act_end_time" value="%%[act_end_time]%%" tabindex="1" /></dd>
            
            <dd>%%[owner_menu]%%</dd>

        </dl>

    	%%[act_url,input_hidden]%%
		%%[act_id,input_hidden]%%
		%%[act_type,input_hidden]%%
		<!--%%[act_time,input_hidden]%%
		%%[act_end_time,input_hidden]%%-->

		<ul class="submit">
        <li><input type="submit" name="next_act" value="Save + New" tabindex="1"onClick="return testfields(this)"; /> 
        <input type="submit" name="close_act" value="Save + Close" tabindex="1"onClick="return testfields(this)"; /> 
        <input type="submit" name="cancel" value="Cancel" tabindex="1" /></li>
        </ul>

    </div> <!-- /#activity -->

    %%[deleteActivity]%%
		
</form>

<script language="JavaScript" type="text/javascript">
<!--
document.ea.act_url.value="cal_day.php";
document.ea.summary.focus();
var old_dob_length = 0;

function pika_date(what)
{
	if (what.value.length == 2 && old_dob_length == 1)
	{
		what.value += '/';
	}

	if (what.value.length == 5 && old_dob_length == 4)
	{
		what.value += '/';
	}

	old_dob_length = what.value.length;
}

var ac_autotab_on = 1;
function testfields(what) {
  if((document.ea.act_date.value=="") || (document.ea.user_id.value=="")){

alert("Staff and Date are required to save this record");
return false;
  }
  return true;
 }
//--> 
</script>

%%[textFormat.js,javascript]%%
%%[ajax_init.js,javascript]%%
%%[setFunding.js,javascript,parse]%%

%%[end:C]%%



<!-- Tickler entry -->

%%[begin:K]%%

<form action="%%[base_url]%%/ops/update_activity.php" name="ea" method="post">

    <h2>Tickler Item</h2>

    <div id="activity">

        <dl>

            <dt><label>Case</label></dt>
            <dd>%%[new_case_menu]%%</dd>
        
        	<dt><label>Subject</label></dt>
            <dd>%%[subject,input_textarea,rows=1,cols=44]%%</dd>
            
            <dt><label>Description</label></dt>
            <dd>%%[summary,input_textarea,rows=1,cols=44]%%</dd>
          
             <dt><label>Where</label></dt>
            <dd>%%[location_long,input_textarea,rows=1,cols=44]%%</dd>  
            <dd>%%[owner_menu]%%</dd>
            
        </dl>
        
        <dl>
        
             <dt><label>Date</label></dt>
            <dd id="work-date">%%[act_date,input_date]%% onkeydown="pika_date(this);"maxlength="10" tabindex="1" /></dd>
        
                     <dt><label>Start Time</label></dt>
<!--            <dd id="start"><input type="text" name="act_time" value="%%[act_time]%%" tabindex="1" maxlength="8"  onChange="return Addendtime()"; /></dd> -->
		<dd id="start">%%[act_time,tickle_times]%% </dd>

           <dt><label>End Time</label></dt>
		<dd id="end">%%[act_end_time,tickle_times]%% </dd>
<!--            <dd id="end"><input type="text" name="act_end_time" value="%%[act_end_time]%%" tabindex="1" maxlength="8" onChange="return Addendtime()";/></dd>-->
            
            <dd>%%[completed,yes_no,checkbox]%% <label>Completed</label></dd>
    
        </dl>
        
		%%[act_url,input_hidden]%%
		%%[act_id,input_hidden]%%
		%%[act_type,input_hidden]%%
		<!--%%[act_time,input_hidden]%%
		%%[act_end_time,input_hidden]%%-->

        <ul class="submit">
        <li><input type="submit" name="next_act" value="Save + New" tabindex="1"onClick="return testfields(this)"; /> 
        <input type="submit" name="close_act" value="Save + Close" tabindex="1"onClick="return testfields(this)"; /> 
        <input type="submit" name="cancel" value="Cancel" tabindex="1" /></li>
        </ul>

    </div> <!-- /#activity -->

    %%[deleteActivity]%%
		
</form>

<script language="JavaScript" type="text/javascript">
<!--
document.ea.summary.focus();
document.ea.act_url.value="cal_day.php";
var old_dob_length = 0;

function pika_date(what)
{
	if (what.value.length == 2 && old_dob_length == 1)
	{
		what.value += '/';
	}

	if (what.value.length == 5 && old_dob_length == 4)
	{
		what.value += '/';
	}

	old_dob_length = what.value.length;
}

var ac_autotab_on = 1;
function testfields(what) {
  if((document.ea.act_date.value=="") || (document.ea.user_id.value=="") || (document.ea.case_id.value=="")){

alert("Staff, Case and Date are required to save this record");
return false;
  }
  return true;
 }

//--> 
</script>

%%[textFormat.js,javascript]%%
%%[ajax_init.js,javascript]%%
%%[setFunding.js,javascript,parse]%%

%%[end:K]%%




<!-- OSR data -->

%%[begin:L]%%

<form action="%%[base_url]%%/ops/update_activity.php" name="ea" method="post">

    <h2>Other Services Data (OSRs)</h2>

    <div id="activity">

        <dl id="osr01">

             <dt><label>Date</label></dt>
            <dd id="work-date">%%[act_date,input_date]%% onkeydown="pika_date(this);"maxlength="10" tabindex="1" /></dd>
            
            <dt><label>Start Time</label></dt>
            <dd>%%[act_time,input_text]%%</dd>
            
            <dt><label>End Time</label></dt>
            <dd>%%[act_end_time,input_text]%%</dd>
            
            <dt><label>Measured</label></dt>
            <dd>%%[ph_measured,input_text]%%</dd>
            
            <dt><label>Estimated</label></dt>
            <dd>%%[ph_estimated,input_text]%%</dd>
            
            <dt><label>Media | PSAs</label></dt>
            <dd>%%[media_items,input_text]%%</dd>
          
        </dl>
        
        <dl id="osr02">

            <dd id="staff">%%[owner_menu]%%</dd>

            <dd>%%[lsc_problem_menu]%%</dd>
            
            <dt><label>Service Provided</label></dt>
            <dd>%%[om_code,lsc_other_matters]%%</dd>
            
            <!-- <dt><label>Summary | Title</label></dt>
            <dd>%%[summary,input_textarea,cols=35,rows=1]%%</dd> -->
            
            <dt><label>Brief Description of Service Provided</label></dt>
            <dd>%%[notes,input_textarea,rows=2,cols=44]%%</dd>
            
            <dt><label>If Estimated, How?</label></dt>
            <dd>%%[estimate_notes,input_textarea,cols=35,rows=2]%%</dd>
            
        </dl>
        
        <dl id="funds-osr">        
        
            <dt><label>Funding 01</label></dt>
            <dd>%%[funding,funding]%%</dd>
        
            <dt><label>Funding 02</label></dt>
            <dd>%%[funding1,funding]%%</dd>
        
            <dt><label>Funding 03</label></dt>
            <dd>%%[funding2,funding]%%</dd>
        
            <dt><label>Funding 04</label></dt>
            <dd>%%[funding3,funding]%%</dd>


	        
        </dl>
        	%%[location,input_hidden]%%
		%%[act_url,input_hidden]%%
		%%[act_id,input_hidden]%%
		%%[act_type,input_hidden]%%
		
        <ul class="submit">
        <li><input type="submit" name="next_act" value="Save + New" tabindex="1" onClick="return testfields(this)"; /> 
        <input type="submit" name="close_act" value="Save + Close" tabindex="1" onClick="return testfields(this)";/> 
        <input type="submit" name="cancel" value="Cancel" tabindex="1" /></li>
        </ul>
		
    </div> <!-- /#activity -->
    
    %%[deleteActivity]%%
    
</form>

<script language="JavaScript" type="text/javascript">
<!--
document.ea.problem.focus();
document.ea.act_url.value="cal_day.php";
var old_dob_length = 0;

function pika_date(what)
{
	if (what.value.length == 2 && old_dob_length == 1)
	{
		what.value += '/';
	}

	if (what.value.length == 5 && old_dob_length == 4)
	{
		what.value += '/';
	}

	old_dob_length = what.value.length;
}

var ac_autotab_on = 1;
function testfields(what) {
  if((document.ea.act_date.value=="") || (document.ea.user_id.value=="") || (document.ea.problem.value=="") || (document.ea.notes.value=="") || (document.ea.om_code.value=="")){

alert("Staff, Problem Code, Brief Summary, Service Provided and Date are required to save this record");
return false;
  }
  return testfields2(what);
 }

function testfields2(what) {
  if((document.ea.ph_measured.value=="") && (document.ea.ph_estimated.value=="")){

alert("Either Measured or Estimated are required to save this record");
return false;
  }
  return testfields3(what);
 }

function testfields3(what) {
  if((document.ea.estimate_notes.value!=="") && (document.ea.ph_estimated.value=="")){

alert("Estimated and If Estimated, How? must be completed if either have values");
return false;
  }
  return testfields4(what);
 }
function testfields4(what) {
  if((document.ea.estimate_notes.value=="") && (document.ea.ph_estimated.value!=="")){

alert("Estimated and If Estimated, How? must be completed if either have values");
return false;
  }
  return testfields5(what);
 }

function testfields5(what) {
  if((document.ea.ph_measured.value!=="") && (document.ea.ph_estimated.value!=="")){

alert("Measured and Estimated cannot both have values");
return false;
  }
  return true;
 }




//--> 
</script>


%%[ajax_init.js,javascript]%%
%%[setFunding.js,javascript,parse]%%

%%[end:L]%%


<!-- Time Slip -->

%%[begin:T]%%

<div id="time-slip">

<form action="%%[base_url]%%/ops/update_activity.php" name="ea" method="post">

    <h2>Time Slip</h2>

    <div id="activity">

        <dl>
	
            <dt><label>Work Type</label><dt>
            <dd>%%[category,category]%%</dd>
        
            <dt><label>Case Record</label><dt>
            <dd>%%[new_case_menu]%%</dd>
        
            <dt><label>Summary | Title</label></dt>
            <dd>%%[summary,input_textarea,rows=1,cols=44]%%</dd>
        
            <dt><label>Notes</label></dt>
            <dd class="notes">%%[notes,input_textarea,rows=10,cols=44]%%</dd>
        
        </dl>
        
        
        <dl id="owner">         
            <dd id="staff-member">%%[owner_menu]%%</dd>
        
             <dt><label>Date</label></dt>
            <dd id="work-date">%%[act_date,input_date]%% onkeydown="pika_date(this);"maxlength="10" tabindex="1" /></dd>
        
            <dt><label>Hours Worked</label><dt>
            <dd id="hours-worked">%%[hours,input_text]%%</dd>

	     <!-- <dt><label>Start Time</label><dt>
            <dd id="work-date"><input type="text" name="act_time" value="%%[act_time]%%"maxlength="10" tabindex="1" /></dd> -->        
        </dl>
        
        <ul id="ts-checks">
        <li>%%[paitime,yes_no,checkbox]%% <label>PAI Time?</label></li>
        <li>%%[senior_cc,yes_no,checkbox]%% <label>Client Contact?</label></li>
        <li>%%[senior_ce,yes_no,checkbox]%% <label>Client Education?</label></li>
        </ul>

        <dl id="funds">                
            <dt><label>Funding 01</label></dt>
            <dd>%%[funding,funding]%%</dd>
        
            <dt><label>Funding 02</label></dt>
            <dd>%%[funding1,funding]%%</dd>
        
            <dt><label>Funding 03</label></dt>
            <dd>%%[funding2,funding]%%</dd>
        
            <dt><label>Funding 04</label></dt>
            <dd>%%[funding3,funding]%%</dd>       
        </dl>

        <input type="hidden" name="completed" value="1" />
        %%[act_url,input_hidden]%%
        %%[act_id,input_hidden]%%
        %%[act_type,input_hidden]%%
        <!--%%[act_time,input_hidden]%%-->
        %%[act_end_time,input_hidden]%%

        <ul class="submit">
        <li><input type="submit" name="next_act" value="Save + New" tabindex="1"onClick="return testfields(this)"; /> 
        <input type="submit" name="close_act" value="Save + Close" tabindex="1" onClick="return testfields(this)";/> 
        <input type="submit" name="cancel" value="Cancel" tabindex="1" /></li>
        </ul>

    </div> <!-- /#activity -->
    
    </div> <!-- /#time-slip -->
    
    %%[deleteActivity]%%
    
</form>

<script language="JavaScript" type="text/javascript">
<!--
document.ea.category.focus();
document.ea.act_url.value="cal_day.php";
var old_dob_length = 0;

function pika_date(what)
{
	if (what.value.length == 2 && old_dob_length == 1)
	{
		what.value += '/';
	}

	if (what.value.length == 5 && old_dob_length == 4)
	{
		what.value += '/';
	}

	old_dob_length = what.value.length;
}

var ac_autotab_on = 1;

function testfields(what) {
  if((document.ea.funding.value=="") || (document.ea.act_date.value=="") || (document.ea.user_id.value=="") || (document.ea.category.value=="")){

alert("Funding code, Staff, Work Type and Date are required to save this record");
return false;
  }
  return true;
 }
//--> 
</script>


%%[textFormat.js,javascript]%%
%%[ajax_init.js,javascript]%%
%%[setFunding.js,javascript,parse]%%

%%[end:T]%%


<!-- Case note -->

%%[begin:N]%%

<form action="%%[base_url]%%/ops/update_activity.php" name="ea" method="post">

    <h2>Case Note</h2>

    <div id="activity">

        <dl>
	
            
        
            <dt><label>Case Record</label><dt>
            <dd>%%[new_case_menu]%%</dd>
        
            <dt><label>Summary | Title</label></dt>
            <dd>%%[summary,input_textarea,rows=1,cols=44]%%</dd>
        
            <dt><label>Notes</label></dt>
            <dd class="notes">%%[notes,input_textarea,rows=10,cols=44]%%</dd>
        
        </dl>
        
        
        <dl id="owner">        
        
            <dd>%%[owner_menu]%%</dd>
        
            <dt><label>Date</label></dt>
            <dd id="work-date">%%[act_date,input_date]%% onkeydown="pika_date(this);"maxlength="10" tabindex="1" /></dd>
        
            <dt><label>Hours Worked</label><dt>
            <dd id="hours-worked">%%[hours,input_text]%%</dd>
        
	    <dt><label>Start Time</label><dt>
            <dd id="work-date"><input type="text" name="act_time" value="%%[act_time]%%"maxlength="10" tabindex="1" /></dd>
        </dl>
        
        <ul id="ts-checks">
        <li>%%[paitime,yes_no,checkbox]%% <label>PAI Time?</label></li>
        <li>%%[senior_cc,yes_no,checkbox]%% <label>Client Contact?</label></li>
        <li>%%[senior_ce,yes_no,checkbox]%% <label>Client Education?</label></li>
        </ul>

        <dl id="funds">        
        
            <dt><label>Funding 01</label></dt>
            <dd>%%[funding,funding]%%</dd>
        
            <dt><label>Funding 02</label></dt>
            <dd>%%[funding1,funding]%%</dd>
        
            <dt><label>Funding 03</label></dt>
            <dd>%%[funding2,funding]%%</dd>
        
            <dt><label>Funding 04</label></dt>
            <dd>%%[funding3,funding]%%</dd>
        
        </dl>
        
    <input type="hidden" name="completed" value="1" />
    <input type="hidden" name="category" value="CS" />
    %%[act_url,input_hidden]%%
    %%[act_id,input_hidden]%%
    %%[act_type,input_hidden]%%
    <!--%%[act_time,input_hidden]%%-->
    %%[act_end_time,input_hidden]%%
    <input type="hidden" name="category" value="CS" />
    <ul class="submit">
    <li><input type="submit" name="next_act" value="Save + New" tabindex="1"onClick="return testfields(this)"; />
    <input type="submit" name="close_act" value="Save + Close" tabindex="1"onClick="return testfields(this)"; />
    <input type="submit" name="cancel" value="Cancel" tabindex="1" /></li>
    </ul>        

</div> <!-- /#activity -->

    %%[deleteActivity]%%



<script language="JavaScript" type="text/javascript">
<!--
document.ea.category.focus();
var old_dob_length = 0;

function pika_date(what)
{
	if (what.value.length == 2 && old_dob_length == 1)
	{
		what.value += '/';
	}

	if (what.value.length == 5 && old_dob_length == 4)
	{
		what.value += '/';
	}

	old_dob_length = what.value.length;
}

var ac_autotab_on = 1;
function testfields(what) {
  if((document.ea.funding.value=="") || (document.ea.act_date.value=="") || (document.ea.user_id.value=="")){

alert("Funding code, Staff and Date are required to save this record");
return false;
  }
  return true;
 }

//--> 
</script>


%%[ajax_init.js,javascript]%%
%%[setFunding.js,javascript,parse]%%

%%[end:N]%%

%%[begin:confirm_delete]%%

<p>
Once an Activity Record is deleted, you cannot undelete it. Are you sure you want to delete this Activity Record?
</p>

<form action="%%[base_url]%%/ops/delete_activity.php" method="POST">
	<input type=hidden name=act_id value=%%[act_id]%%>
	<input type="submit" name="delete" value="Delete" />
	<input type="submit" name="cancel" value="Cancel" />
</form>

%%[end:confirm_delete]%%
